import { Component } from "react";
import { Switch } from "react-router-dom";
// 私有路由组件
// 私有组件方法
import PrivateRouter from "../PrivateRouter";

// // 用户
// import UserList from "../../views/user/List";
// import UserAdd from "../../views/user/Add";
// // 部门
// import DepartmentList from "../../views/department/List";
// import DepartmentAdd from "../../views/department/Add";

import RouterArr from './components'


class LayoutMain extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }
  render() {
    return (
      <Switch>
        
        {RouterArr.map(item=>{
          const { component , path } = item 
          return <PrivateRouter component={component} exact path={path} key={path}/>
        })}

        {/* <PrivateRouter component={UserList} exact path="/index/user/list" />
        <PrivateRouter component={UserAdd} exact path="/index/user/add" />
        <PrivateRouter component={DepartmentList} exact path="/index/department/list" />
        <PrivateRouter component={DepartmentAdd} exact path="/index/department/add" /> */}
      </Switch>
    );
  }
}

export default LayoutMain;
